<template>
  <el-dialog title="新增/编辑" :close-on-click-modal="false" append-to-body
             :visible.sync="visible" class="cu-dialog cu-dialog_center" lock-scroll width="880px">
    <el-row :gutter="15" class="" >
      <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right"  :rules="rules">
        <el-col :span="12">
          <el-form-item label="照片" prop="photoPath">
            <custom-upload-img :type="'lecturer'" v-model="dataForm.photoPath" :fileSize="500" sizeUnit="MB" :limit="1"  ></custom-upload-img>
          </el-form-item>
        </el-col>
        <el-col :span="12"  >
          <el-row>
            <el-col :span="24">
              <el-form-item label="姓名" prop="name">
                <el-input v-model="dataForm.name" placeholder="请输入姓名" clearable required :style="{ width: '100%' }" ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24" >
              <el-form-item label=部门 prop="departmentId">
                <custom-tree-select v-model="dataForm.departmentId" :options="departmentTreeData" placeholder="选择部门" clearable />
              </el-form-item>
            </el-col>
            <el-col :span="24" >
              <el-form-item label="性别" prop="gender">
                <el-select v-model="dataForm.gender" placeholder="选择性别" clearable :style="{ width: '100%' }">
                  <el-option v-for="item in genderOptions" :key="item.enCode" :label="item.fullName" :value="item.enCode" />
                </el-select>

              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="类别" prop="category" >
                <el-select v-model="dataForm.category" placeholder="请选择类别" filterable clearable required :style="{ width: '100%' }"  >
                  <el-option :key="item.enCode" :label="item.fullName" :value="item.enCode" v-for="item in categoryOptions" />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>

        <el-col :span="12">
          <el-form-item label="讲师级别" prop="lecturerLevel"  >
            <el-select v-model="dataForm.lecturerLevel" placeholder="请选择讲师级别" filterable clearable required :style="{ width: '100%' }"  >
              <el-option :key="item.enCode" :label="item.fullName" :value="item.enCode" v-for="item in lecturerLevelOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="是否启用" prop="enabledMark">
            <el-checkbox v-model="dataForm.enabledMark" ></el-checkbox>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="讲师介绍" prop="lecturerIntroduction" >
            <el-input v-model="dataForm.lecturerIntroduction" type="textarea"
                      :rows="2" placeholder="请输入讲师介绍" clearable required :style="{ width: '100%' }"  ></el-input>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" :loading='loading'>确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export { default } from './index.js'
</script>
